package com.hua.designpattern.structural.proxy;

public class GameConcreteReverse implements GameInterface {

	private GameInterface proxy;

	public GameProxy getProxy() {
		this.proxy = new GameConcreteReverse();
		return new GameProxy(this);
	}

	@Override
	public void login(String name) {
		if (proxy != null) {
			System.out.println("concrete: Hello " + name + " login");
		} else {
			System.out.println("********please invoke proxy login");
		}

	}

	@Override
	public void playGame() {
		if (proxy != null) {
			System.out.println("concrete: play game");
		} else {
			System.out.println("********please invoke proxy play");
		}
	}

	@Override
	public void logout(String name) {
		if (proxy != null) {
			System.out.println("concrete: Goodbye " + name + " logout");
		} else {
			System.out.println("********please invoke proxy logout");
		}

	}

}
